import { Component } from "react";

export default function higherOrder(Contex){
  // return class extends Component {  匿名也可以
  return class Gjzjhs extends Component {
    constructor(props) {
      super(props);
      this.state = { 
        aa:'你好',
        xiugai:(ctx)=>{
          this.setState({
            aa:ctx
          })
        }
      }
    }
    render() {
      return(
        <div>
          <Contex {...this.state} onceshi={this.ceshi}></Contex>
          <div>这里是高阶组件提供的:{this.state.aa}</div>
        </div>
      )
    }

    ceshi = (ctn) => {
      this.setState({
        aa:ctn
      })
    }
  }
}